﻿using System;
using RenderHeads.Media.AVProVideo;
using UnityEngine;

// Token: 0x020002B8 RID: 696
public class DemoMovie : Scene
{
	// Token: 0x06001197 RID: 4503 RVA: 0x00071F18 File Offset: 0x00070118
	private void Start()
	{
		base.InScene(true);
		this.gameCtrl.audioCtrl.BGM_Stop();
	}

	// Token: 0x06001198 RID: 4504 RVA: 0x00071F34 File Offset: 0x00070134
	private void Update()
	{
		if (Input.GetMouseButtonDown(0) || Input.GetKeyDown(KeyCode.Escape))
		{
			this.Exit();
		}
	}

	// Token: 0x06001199 RID: 4505 RVA: 0x00071F54 File Offset: 0x00070154
	public void OnVideoEvent(MediaPlayer mp, MediaPlayerEvent.EventType et, ErrorCode errorCode)
	{
		if (et == MediaPlayerEvent.EventType.ReadyToPlay)
		{
			this.player.Control.SetVolume(ConfigData.volume_master);
			mp.Play();
		}
		else if (et == MediaPlayerEvent.EventType.FinishedPlaying)
		{
			this.Exit();
		}
	}

	// Token: 0x0600119A RID: 4506 RVA: 0x00071F8C File Offset: 0x0007018C
	private void Exit()
	{
		base.GC.ChangeScene("TitleScene", string.Empty, 1f);
	}

	// Token: 0x0400136E RID: 4974
	[SerializeField]
	private MediaPlayer player;
}
